<template>
  <div class="dialog readonly">
    <el-dialog
      title="招标详情"
      :visible.sync="dialogFormVisible"
      @close="close"
      width="80%"
      :destroy-on-close="true"
    >
      <el-tabs v-model="activeName">
        <el-tab-pane label="招标详情" name="1"></el-tab-pane>
        <el-tab-pane label="中标单位详情" name="2"></el-tab-pane>
      </el-tabs>
      <div class="tab" v-show="activeName == '1'">
        <el-form :model="form" :rules="rules" ref="form">
          <el-row :gutter="20">
            <el-col :span="24">
              <el-form-item prop="name" label="项目名称">
                <el-input size="medium" v-model="xmmc" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item prop="bdmc" label="标段名称">
                <el-input size="medium" v-model="form.bdmc" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item prop="zb_bh" label="招标编号">
                <el-input size="medium" v-model="form.zb_bh" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item prop="zb_nrfl" label="招标内容分类">
                <el-select
                  size="medium"
                  v-model="form.zb_nrfl"
                  placeholder="请选择活动区域"
                  style="width:100%;"
                  disabled
                >
                  <el-option
                    :label="item.keys"
                    :value="item.values"
                    v-for="item in inner"
                    :key="item.id"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item prop="zb_xs" label="招标形式">
                <el-select
                  size="medium"
                  v-model="form.zb_xs"
                  placeholder="请选择活动区域"
                  style="width:100%;"
                  disabled
                >
                  <el-option
                    :label="item.keys"
                    :value="item.values"
                    v-for="item in Xscode"
                    :key="item.id"
                  ></el-option>
                  <!-- <el-option label="邀请招标" value="beijing"></el-option>
                  <el-option label="竞争性谈判" value="beijing"></el-option>
                  <el-option label="单一来源" value="beijing"></el-option>
                  <el-option label="询价" value="beijing"></el-option>-->
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <!-- <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item prop="name" label="标文件是否编制完成">
                <el-select size="medium" v-model="form.region" placeholder="请选择活动区域">
                  <el-option label="是" value="shanghai"></el-option>
                  <el-option label="否" value="beijing"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item prop="name" label="招标文件是否评审">
                <el-select size="medium" v-model="form.region" placeholder="请选择活动区域">
                  <el-option label="是" value="shanghai"></el-option>
                  <el-option label="否" value="beijing"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>-->
          <el-row :gutter="20">
            <el-col :span="24">
              <el-form-item prop="zb_dlgs" label="招标代理公司">
                <el-input size="medium" v-model="form.zb_dlgs" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="24">
              <el-form-item prop="kb_dd" label="开标地点">
                <el-input size="medium" v-model="form.kb_dd" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item prop="gg_fbsj" label="公告发布时间">
                <el-date-picker
                  value-format="yyyy-MM-dd"
                  v-model="form.gg_fbsj"
                  type="date"
                  placeholder="选择日期"
                  style="width:100%;"
                  disabled
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item prop="kb_sj" label="开标时间">
                <el-date-picker
                  value-format="yyyy-MM-dd"
                  v-model="form.kb_sj"
                  type="date"
                  placeholder="选择日期"
                  style="width:100%;"
                  disabled
                ></el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item prop="zbsx" label="招标上限（万元）">
                <el-input size="medium" v-model="form.zbsx" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item prop="zbj" label="中标价（万元）">
                <el-input size="medium" v-model="form.zbj" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item prop="zbtzsrq" label="中标通知书日期">
                <el-date-picker
                  value-format="yyyy-MM-dd"
                  v-model="form.zbtzsrq"
                  type="date"
                  placeholder="选择日期"
                  style="width:100%;"
                  disabled
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item prop="pbbgbtbarq" label="评标报告报厅备案日期">
                <el-date-picker
                  value-format="yyyy-MM-dd"
                  v-model="form.pbbgbtbarq"
                  type="date"
                  placeholder="选择日期"
                  style="width:100%;"
                  disabled
                ></el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <el-row :gutter="20" style="margin-bottom:20px;">
          <el-col :span="12" class="d-direct">
            <span style="height:60px;" class="d-center">招标公告</span>
            <uploader
              :fileslists="fileslist1"
              :options="options"
              :file-status-text="statusText"
              :fileurl="this.$updata"
              class="uploader-example"
              ref="uploader"
              :app="$route.query.is_sealed == 1"
              @file-success="fileSuccess1"
              @file-remove="remove1"
            ></uploader>
          </el-col>

          <el-col :span="12" class="d-direct">
            <span style="height:60px;" class="d-center">招标文件</span>
            <uploader
              :fileslists="fileslist2"
              :options="options"
              :file-status-text="statusText"
              :fileurl="this.$updata"
              class="uploader-example"
              ref="uploader"
              :app="$route.query.is_sealed == 1"
              @file-success="fileSuccess2"
              @file-remove="remove2"
            ></uploader>
          </el-col>
        </el-row>
        <el-row :gutter="20" style="margin-bottom:20px;">
          <el-col :span="12" class="d-direct">
            <span style="height:60px;" class="d-center">投标文件</span>
            <uploader
              :fileslists="fileslist3"
              :options="options"
              :file-status-text="statusText"
              :fileurl="this.$updata"
              class="uploader-example"
              ref="uploader"
              :app="$route.query.is_sealed == 1"
              @file-success="fileSuccess3"
              @file-remove="remove3"
            ></uploader>
          </el-col>

          <el-col :span="12" class="d-direct">
            <span style="height:60px;" class="d-center">评标报告</span>
            <uploader
              :fileslists="fileslist4"
              :options="options"
              :file-status-text="statusText"
              :fileurl="this.$updata"
              class="uploader-example"
              ref="uploader"
              :app="$route.query.is_sealed == 1"
              @file-success="fileSuccess4"
              @file-remove="remove4"
            ></uploader>
          </el-col>
        </el-row>
        <el-row :gutter="20" style="margin-bottom:20px;">
          <el-col :span="12" class="d-direct">
            <span style="height:60px;" class="d-center">中标通知书</span>
            <uploader
              :fileslists="fileslist5"
              :options="options"
              :file-status-text="statusText"
              :fileurl="this.$updata"
              class="uploader-example"
              ref="uploader"
              :app="$route.query.is_sealed == 1"
              @file-success="fileSuccess5"
              @file-remove="remove5"
            ></uploader>
          </el-col>
        </el-row>
      </div>
      <div class="tab" v-show="activeName == '2'">
        <el-form :model="form" :rules="rules" ref="form1">
          <el-row>
            <el-col :span="24">
              <span class="d-start title">单位信息</span>
            </el-col>
          </el-row>
          <el-row :gutter="10" type="flex" justify="start">
            <el-col :span="16">
              <el-form-item prop="zbdw_id" label="中标单位名称" :label-width="formLabelWidth">
                <el-select
                  size="medium"
                  v-model="form.zbdw_id"
                  placeholder="请选择"
                  @change="Enter($event)"
                  disabled
                >
                  <el-option
                    :label="item.dwmc"
                    :value="item.id"
                    v-for="item in EnterpriseList"
                    :key="item.id"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <!-- <el-col :span="8" class="d-end">
              <el-button
                size="medium"
                type="success"
                plain
                @click="dialogFormVisible2 = !dialogFormVisible2"
                v-if="$route.query.is_sealed == 1"
              >添加企业信息</el-button>
            </el-col>-->
          </el-row>
          <el-row :gutter="10">
            <el-col :span="8">
              <el-form-item prop="name" label="成立日期" :label-width="formLabelWidth">
                <el-input size="medium" v-model="EnterprData.clsj" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item prop="name" label="员工人数" :label-width="formLabelWidth">
                <el-input size="medium" v-model="EnterprData.ygrs" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="8">
              <el-form-item prop="name" label="法人姓名" :label-width="formLabelWidth">
                <el-input size="medium" v-model="EnterprData.frxm" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item prop="name" label="组织机构代码" :label-width="formLabelWidth">
                <el-input size="medium" v-model="EnterprData.zzjgdm" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="8">
              <el-form-item prop="name" label="总经理" :label-width="formLabelWidth">
                <el-input size="medium" v-model="EnterprData.zjl" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item prop="name" label="联系电话" :label-width="formLabelWidth">
                <el-input size="medium" v-model="EnterprData.zjldh" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item prop="name" label="职称" :label-width="formLabelWidth">
                <el-input size="medium" v-model="EnterprData.zjlzc" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="8">
              <el-form-item prop="name" label="技术负责人" :label-width="formLabelWidth">
                <el-input size="medium" v-model="EnterprData.jsfzr" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item prop="name" label="联系电话" :label-width="formLabelWidth">
                <el-input size="medium" v-model="EnterprData.jsdh" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item prop="name" label="职称" :label-width="formLabelWidth">
                <el-input size="medium" v-model="EnterprData.jszc" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="24">
              <el-form-item prop="name" label="企业资质" :label-width="formLabelWidth">
                <el-input size="medium" v-model="EnterprData.qyzz" type="textarea" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="24" class="d-between">
              <span class="d-between title">项目主要人员信息</span>
              <!-- <el-button
                size="medium"
                type="success"
                plain
                @click="dialogFormVisible3 = !dialogFormVisible3"
                v-if="$route.query.is_sealed == 1"
              >添加人员信息</el-button>-->
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="10">
              <el-form-item prop="xmjl_id" label="项目经理姓名" :label-width="formLabelWidth">
                <el-select
                  size="medium"
                  v-model="form.xmjl_id"
                  placeholder="请选择"
                  @change="xmjlSelect($event)"
                  style="width:100%;"
                  disabled
                >
                  <el-option :label="item.xm" :value="item.id" v-for="item in syry" :key="item.id"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item prop="name" label="联系电话" :label-width="formLabelWidth">
                <el-input size="medium" v-model="xmjl.lxdh" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="10">
              <el-form-item prop="name" label="单位任职" :label-width="formLabelWidth">
                <el-input size="medium" v-model="xmjl.dwrz" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item prop="name" label="职称" :label-width="formLabelWidth">
                <el-input size="medium" v-model="xmjl.zc" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <el-row>
          <el-col :span="24">
            <span class="d-start title">项目其他人员信息</span>
          </el-col>
        </el-row>

        <el-form
          v-if="formOtherPerson.length <= 0"
          style="margin:10px 0;"
        >
          <el-row :gutter="10">
            <el-col :span="10">
              <el-form-item  label="姓名" :label-width="formLabelWidth">
                <el-input size="medium"  disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item  label="联系电话" :label-width="formLabelWidth">
                <el-input size="medium" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="10">
              <el-form-item  label="单位任职" :label-width="formLabelWidth">
                <el-input size="medium"  disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item  label="职称" :label-width="formLabelWidth">
                <el-input size="medium"  disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>

        <el-form
          v-else
          :model="item"
          v-for="(item,index) in formOtherPerson"
          :key="index"
          style="margin:10px 0;"
        >
          <el-row :gutter="10">
            <el-col :span="10">
              <el-form-item prop="name" label="姓名" :label-width="formLabelWidth">
                <el-select
                  size="medium"
                  v-model="item.id"
                  placeholder="请选择"
                  disabled
                  style="width:100%;"
                >
                  <el-option
                    :label="items.xm"
                    :value="items.id"
                    v-for="items in ptcy"
                    :key="items.id + '^-^'"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item prop="name" label="联系电话" :label-width="formLabelWidth">
                <el-input size="medium" v-model="item.lxdh" disabled></el-input>
              </el-form-item>
            </el-col>

            <!-- <el-col :span="3" class="d-end">
              <el-form-item>
                <el-button
                  size="medium"
                  icon="el-icon-minus"
                  type="success"
                  @click="del(index)"
                  v-if="$route.query.is_sealed == 1"
                ></el-button>
              </el-form-item>
            </el-col>-->
          </el-row>
          <el-row :gutter="10">
            <el-col :span="10">
              <el-form-item prop="name" label="单位任职" :label-width="formLabelWidth">
                <el-input size="medium" v-model="item.dwrz" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item prop="name" label="职称" :label-width="formLabelWidth">
                <el-input size="medium" v-model="item.zc" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <!-- <el-form :model="formNull" :rules="rules" ref="formNull" v-if="$route.query.is_sealed == 1">
          <el-divider></el-divider>
          <el-row :gutter="10">
            <el-col :span="10">
              <el-form-item prop="id" label="姓名" :label-width="formLabelWidth">
                <el-select
                  size="medium"
                  v-model="formNull.id"
                  placeholder="请选择"
                  @change="formNullp($event)"
                  style="width:100%;"
                >
                  <el-option
                    :label="items.xm"
                    :value="items.id"
                    v-for="(items) in syry"
                    :key="items.id + 'llll'"
                    :disabled="items.id == form.xmjl_id"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item prop="name" label="联系电话" :label-width="formLabelWidth">
                <el-input size="medium" v-model="formNull.lxdh" disabled></el-input>
              </el-form-item>
            </el-col>

            <el-col :span="3" class="d-end">
              <el-form-item>
                <el-button size="medium" icon="el-icon-plus" type="success" @click="addOther()"></el-button>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :span="10">
              <el-form-item prop="name" label="单位任职" :label-width="formLabelWidth">
                <el-input size="medium" v-model="formNull.dwrz" disabled></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item prop="name" label="职称" :label-width="formLabelWidth">
                <el-input size="medium" v-model="formNull.zc" disabled></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>-->
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button size="medium" @click="dialogFormVisible=false">取 消</el-button>
        <!-- <el-button
          size="medium"
          type="primary"
          @click="save"
          v-if="$route.query.is_sealed == 1"
          :loading="loading"
        >保 存</el-button>-->
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: ["dialogFormVisible1", "inner", "Xscode", "item", "xmmc"],
  data() {
    return {
      form: {},
      formOtherPerson: [],
      formNull: {},
      rules: {
        bdmc: [{ required: true, message: "该值不能为空", trigger: "blur" }],
        zb_bh: [{ required: true, message: "该值不能为空", trigger: "blur" }],
        zb_nrfl: [{ required: true, message: "该值不能为空", trigger: "blur" }],
        id: [{ required: true, message: "该值不能为空", trigger: "blur" }],
        dwrz: [{ required: true, message: "该值不能为空", trigger: "blur" }],
        lxdh: [{ required: true, message: "该值不能为空", trigger: "blur" }],
        zc: [{ required: true, message: "该值不能为空", trigger: "blur" }],
        zbdw_id: [{ required: true, message: "该值不能为空", trigger: "blur" }],
        xmjl_id: [{ required: true, message: "该值不能为空", trigger: "blur" }],
      },
      formLabelWidth: "160px",
      dialogFormVisible: false,
      activeName: "1",
      dialogFormVisible2: false,
      dialogFormVisible3: false,
      resdata: [],
      fileslist1: [],
      fileslist2: [],
      fileslist3: [],
      fileslist4: [],
      fileslist5: [],
      options: {
        target: this.$updata + "/api/index/uploads", // '//jsonplaceholder.typicode.com/posts/',
        testChunks: false,
      },
      statusText: {
        success: "成功了",
        error: "出错了",
        uploading: "上传中",
        paused: "暂停中",
        waiting: "等待中",
      }, //上传
      EnterprData: {},
      EnterpriseList: [],
      xmjl: {},
      ptcy: [],
      syry: [], //可选择人员
      saveHide: false,
      loading: false,
    };
  },
  methods: {
    close() {
      this.$emit("close", this.saveHide);
    },
    save() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.loading = true;
          let fileUrl = this.fileslist1.map((v) => {
            return v.path;
          });
          let fileUr2 = this.fileslist2.map((v) => {
            return v.path;
          });
          let fileUr3 = this.fileslist3.map((v) => {
            return v.path;
          });
          let fileUr4 = this.fileslist4.map((v) => {
            return v.path;
          });
          let fileUr5 = this.fileslist5.map((v) => {
            return v.path;
          });
          console.log(fileUrl);
          this.form.files_zbgg = fileUrl.join(",");
          this.form.files_zbwj = fileUr2.join(",");
          this.form.files_tbwj = fileUr3.join(",");
          this.form.files_pbbg = fileUr4.join(",");
          this.form.files_zbtzs = fileUr5.join(",");
          this.form.xm_id = this.$route.query.xm_id;
          delete this.form.zbdw_obj;
          delete this.form.xmjl_obj;
          this.$post("/api/QqBdgl/actions", this.form).then((res) => {
            if (res.code == 200) {
              this.$message({
                message: res.msg,
                type: "success",
              });
              this.saveHide = true;

              this.dialogFormVisible = false;
            } else {
              this.$message({
                message: res.msg,
                type: "error",
              });
            }
            this.loading = false;
          });
        } else {
          return false;
        }
      });
    },

    app(x, y) {
      if (this.form[x]) {
        this[y] = this.form[x].split(",").map((v) => {
          return { url: `${v}`, fullUrl: `${this.$updata}${v}` };
        });
      } else {
        this[y] = [];
      }
    },
    //上传组件移除返回
    remove1(index) {
      this.fileslist1.splice(index, 1);
    },
    remove2(index) {
      this.fileslist2.splice(index, 1);
    },
    remove3(index) {
      this.fileslist3.splice(index, 1);
    },
    remove4(index) {
      this.fileslist4.splice(index, 1);
    },
    remove5(index) {
      this.fileslist5.splice(index, 1);
    },
    //上传成功返回
    fileSuccess1(rootFile, file, message, chunk) {
      if (JSON.parse(message).state == "success") {
        this.fileslist1.push({
          path: JSON.parse(message).code,
          name: chunk.file.name,
        });
        console.log(this.fileslist1);
      } else {
        this.$message({
          message: chunk.file.name + JSON.parse(message).code,
          type: "error",
        });
      }
    },
    fileSuccess2(rootFile, file, message, chunk) {
      if (JSON.parse(message).state == "success") {
        this.fileslist2.push({
          path: JSON.parse(message).code,
          name: chunk.file.name,
        });
      } else {
        this.$message({
          message: chunk.file.name + JSON.parse(message).code,
          type: "error",
        });
      }
    },
    fileSuccess3(rootFile, file, message, chunk) {
      if (JSON.parse(message).state == "success") {
        this.fileslist3.push({
          path: JSON.parse(message).code,
          name: chunk.file.name,
        });
      } else {
        this.$message({
          message: chunk.file.name + JSON.parse(message).code,
          type: "error",
        });
      }
    },
    fileSuccess4(rootFile, file, message, chunk) {
      if (JSON.parse(message).state == "success") {
        this.fileslist4.push({
          path: JSON.parse(message).code,
          name: chunk.file.name,
        });
      } else {
        this.$message({
          message: chunk.file.name + JSON.parse(message).code,
          type: "error",
        });
      }
    },
    fileSuccess5(rootFile, file, message, chunk) {
      if (JSON.parse(message).state == "success") {
        this.fileslist5.push({
          path: JSON.parse(message).code,
          name: chunk.file.name,
        });
      } else {
        this.$message({
          message: chunk.file.name + JSON.parse(message).code,
          type: "error",
        });
      }
    },
    persion(item) {
      this.EnterpriseList.forEach((v) => {
        if (v.id == item) {
          this.EnterprData = { ...v };
          this.ptcy = [...this.EnterprData.users];
          this.syry = [...this.ptcy];
        }
      });
    },
    getEnt(a = 1) {
      this.$get("/api/Enterprise/getlist", {}).then((res) => {
        if (res.code == 200) {
          this.EnterpriseList = [...res.data];
          this.persion(this.form.zbdw_id);
          if (a == 2 && Object.values(this.form).length > 0) {
            let aa = [];
            if (this.form.qtry_ids) {
              aa = this.form.qtry_ids.split(",");
            }
            this.formOtherPerson = [];
            aa.forEach((v) => {
              this.EnterprData.users.forEach((vv) => {
                if (v == vv.id) this.formOtherPerson.push(vv);
              });
            });
            this.formOtherPerson.forEach((vv) => {
              if (vv.unitinfo) {
                vv.zc = JSON.parse(vv.unitinfo)
                  .map((v) => {
                    return v.zc;
                  })
                  .join(",");
              }
              this.syry.forEach((v, index) => {
                if (vv.id == v.id) {
                  this.syry.splice(index, 1);
                }
              });
            });
            // if (this.xmjl.id) {
            //   this.syry = this.syry.filter(v => {
            //     return v.id != this.xmjl.id ? this.xmjl.id : "";
            //   });
            // }
            // this.$forceUpdate();
          }
        }
      });
    },
  },
  mounted() {
    this.getEnt(2);
  },
  watch: {
    dialogFormVisible1(news) {
      this.dialogFormVisible = news;
      this.$nextTick(() => {
        this.activeName = "1";
      });
      this.form = {};
      this.form = { ...this.item };
      this.app("files_zbgg", "fileslist1");
      this.app("files_zbwj", "fileslist2");
      this.app("files_tbwj", "fileslist3");
      this.app("files_pbbg", "fileslist4");
      this.app("files_zbtzs", "fileslist5");

      this.fileslist1 = this.form.files_zbgg ? this.form.files_zbgg_arr : [];
      this.fileslist2 = this.form.files_zbwj ? this.form.files_zbwj_arr : [];
      this.fileslist3 = this.form.files_tbwj ? this.form.files_tbwj_arr : [];
      this.fileslist4 = this.form.files_pbbg ? this.form.files_pbbg_arr : [];
      this.fileslist5 = this.form.files_zbtzs ? this.form.files_zbtzs_arr : [];
      if (this.form.zbdw_id == 0) {
        this.form.zbdw_id = null;
      }
      if (this.form.xmjl_id == 0) {
        this.form.xmjl_id = null;
      }
      //   console.log(this.form);
      this.formNull = {};
      this.getEnt(2);
      if (Object.values(this.item).length > 0) {
        if (this.item.zbdw_id != 0)
          this.EnterprData = { ...this.item.zbdw_obj };
        if (this.item.xmjl_id != 0) {
          this.xmjl = { ...this.item.xmjl_obj };
          this.xmjl.zc = JSON.parse(this.xmjl.unitinfo)
            .map((v) => {
              return v.zc;
            })
            .join(",");
        }
      }
      if (!news) {
        this.form = {};
        this.resdata = [];
        this.EnterprData = {};
        this.EnterpriseList = [];
        this.xmjl = {};
        this.ptcy = [];
        this.syry = []; //可选择人员
      }
    },
  },
  computed: {},
};
</script>

<style scoped lang="less">
.d-direct {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  flex-direction: column;
}
.imgUpdata {
  width: 100%;
  height: 62px;
  border: 1px solid #ccc;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  .imgList {
    height: 100%;
    width: calc(100% - 64px);
  }
  .imgBtn {
    position: absolute;
    right: 0;
    top: 0;
    width: 60px;
    height: 100%;
    background: #ccc;
    border: 1px dashed #ccc;
    flex-shrink: 0;
    cursor: pointer;
    &:hover {
      border: 1px dashed blue;
    }
  }
}
.img {
  width: 100%;
  height: 100px;
  border: 1px solid #ccc;
  i {
    img {
      width: 130px;
      height: 95px;
      padding: 5px;
    }
  }
}
.tab {
  width: 100%;
  height: calc(100% - 54px);
}
.title {
  //   width: 120px;
  padding: 10px 12px;
  font: 20px bold;
  color: #226ab6;
}
</style>